import java.util.Arrays;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();

        String input = sc.nextLine();

        // 使用StringTokenizer解析输入
        StringTokenizer tokenizer = new StringTokenizer(input, ",");
        int[] numbers = new int[tokenizer.countTokens()];

        for (int i = 0; tokenizer.hasMoreTokens(); i++) {
            numbers[i] = Integer.parseInt(tokenizer.nextToken().trim());
        }
        int max = max(a,b);
        int min = min(a,b);
        System.out.println("最大公约数和最小公倍数为(" + max + "," + min + ")");
    }

    private static int max(int a, int b) {

        while (b!= 0){
            int max = b;
            b = a % b;
            a = max;
        }
        return a;
    }
    private static int min(int a, int b) {
        return a/ max(a,b) * b;
    }

    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Arrays.sort(arr);
        for (int i = 0; i < n; i++) {
            if (arr[i] % 2 != 0) {
                System.out.println(arr[i]);
            }
        }
        for (int i = 0; i < n; i++) {
            if (arr[i] % 2 == 0) {
                System.out.println(arr[i]);
            }
        }
    }


    public static void main1(String[] args) {
        System.out.println("WELCOME TO GUES CPA ！");
    }

}

